import http from "../../http"
import { objToUrl } from "../../utils/common";

enum API {
  menuList = "/menu/list",
  editMenu = "/menu/edit",
  delMenu = "/menu/del",
  addMenu = "/menu/add",
}
// 获取菜单
export const getMenuListReq = (data?: any) => http.get<any,any>(API.menuList + objToUrl(data));

// 编辑菜单

export const editMenuLReq = (data:any) => http.post<any,any>(API.editMenu, data)

// 删除菜单
export const delMenuLReq = (data:any) => http.delete<any,any>(API.editMenu + objToUrl(data))

// 新增菜单

export const addMenuReq = (data:any) => http.post<any,any>(API.addMenu, data)